<?xml version="1.0" encoding="UTF-8"?>
<!--
Configure Hazelcast for clustering GeoServer's WPS process status.
For more information, see:
https://docs.hazelcast.com/hazelcast/5.3/configuration/configuring-declaratively
-->
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.hazelcast.com/schema/config
                               https://hazelcast.com/schema/config/hazelcast-config-5.3.xsd">
  <cluster-name>gsWpsCluster</cluster-name>

  <!-- 
     Make Hazelcast use log4j2 just like GeoServer. Remember to add
     a Logger for com.hazelcast with the appropriate logging level
     in the geoserver logging configuration to see Hazelcast log messages
  -->
  <properties>
    <property name="hazelcast.logging.type">log4j2</property>
  </properties>

  <!-- Network section, by default it enables multicast, tune it to use tcp in case 
    multicast is not allowed, and list the nodes that make up a reasonable core of the 
    cluster (e.g., machines that will never be all down at the same time) -->
  <network>
    <port auto-increment="true">5701</port>
    <join>
      <multicast enabled="true">
        <multicast-group>224.2.2.3</multicast-group>
        <multicast-port>54327</multicast-port>
      </multicast>
      <tcp-ip enabled="false">
        <interface>127.0.0.1</interface>
      </tcp-ip>
      <aws enabled="false">
        <access-key>my-access-key</access-key>
        <secret-key>my-secret-key</secret-key>
        <region>us-east-1</region>
      </aws>
    </join>
  </network>
  
  

  <!-- The WPS status map -->
  <map name="wpsExecutionStatusMap">
    <indexes>
      <!-- Add indexes to support the two most common queries -->
      <index type="HASH">
        <attributes>
          <attribute>executionId</attribute>
        </attributes>
      </index>
      <index type="SORTED">
        <attributes>
          <attribute>completionTime</attribute>
        </attributes>
      </index>
    </indexes>
  </map>
</hazelcast>
